"""
@name: utils.py
@auth: zzw
@date: 2022/12/29 12:29
@desc: 
"""
import pickle


def read_data(file_path) -> list:
    try:
        with open(file_path, 'rb+') as f:
            file_data = pickle.load(f)
    except Exception as e:
        return []
    return file_data


def write_data(file_path, data: list) -> bool:
    try:
        with open(file_path, 'wb') as f:
            pickle.dump(data, f)
        return True
    except Exception as e:
        return False


if __name__ == '__main__':

    print()
